<div class="order_pannel">
    <h2 class="mag-tit">订单管理</h2>
    <ul id="order-history" th:unless="${#lists.isEmpty(orders)}">
        <li class="order-tit" th:unless="${isMobile}">
            <span class="order-des">商品</span>
            <span class="order-number">订单号</span>
            <span class="submit-date">日期</span>
            <span class="total" th:text="#{order.total}">Order Total</span>
            <span class="status">状态</span>
            <span class="operate">操作</span>
        </li>
        <li class="order" th:each="order : ${orders}" th:object="${order}" th:attr="data-order-number=*{orderNumber}">
            <span th:unless="${isMobile}" class="order-des">
                <span  th:each="item : *{discreteOrderItems}" th:remove="tag">
<!--     			    <a th:href="@{/account/orders/} + *{orderNumber}" target="_blank"> -->
                    <a th:href="@{${item.product.url}}" target="_blank">
    			        <img th:if="${item.product.media['primary'] != null}"
    			            th:src="@{${item.product.media['primary']?.url} + '?thumbnail'}" width="60" th:alt="${item.product.name}"
                                th:title="${item.product.name}" />
                    </a>
                </span>
            </span>
            <span class="order-number">
                <b th:if="${isMobile}">订单号：</b>
         	    <a th:href="@{/account/orders/} + *{orderNumber}" class="view-order-details" th:text="*{orderNumber}" target="_blank"></a>
            </span>
            <span class="submit-date">
                <b th:if="${isMobile}">日期：</b>
                <s th:text="*{#dates.format(submitDate, 'yyyy-MM-dd')}"></s>
            </span>
            <span class="total">
                <b th:if="${isMobile}">小计：</b>
                <s blc:fsprice="*{total}"></s>
            </span>
            <span class="status">
                <b th:if="${isMobile}">状态：</b>
                <p class="status" th:text="*{status.friendlyType}"></p>
                <p class="status" th:text="*{internalStatus!=null and internalStatus.type.contains('PAYMENT')?internalStatus.friendlyType:''}"></p>
            </span>
            <span class="operate">
                <span th:if="*{status.type=='SUBMITTED'
                    and (internalStatus!=null and (internalStatus.type=='PAYMENT_SUBMITTED' or internalStatus.type=='PAYMENT_FAIL'))}" class="accout-pay">
				    <form blc:fs_payment_gateway_action="${paymentRequestDTO}" order_repay="${order}" complete_checkout="${true}" METHOD="POST" target="_blank" class="repay">
					    <input type="hidden" name="order_id" th:value="*{id}" />
						<input type="hidden" name="order_amount" th:value="*{total}" />
						<input type="hidden" name="item_title" th:value="#{cart.itemTitle}" />
						<input type="hidden" name="item_desc" th:value="#{cart.itemDesc}" />
						<input type="submit" id="rePay" class="medium red"	th:value="#{order.payAgain}" />
					</form>
                </span>
                <a th:href="@{/account/orders/} + *{orderNumber}" class="lookorder" target="_blank">查看订单</a>
            </span>
        </li>
    </ul>
    
    <h3 th:if="${#lists.isEmpty(orders)}">您还未购买任何东西。</h3>

</div>